package com.spring.bean.page;

/**
 * @author JHC 传递参数，开始索引和每页记录数
 */
public class Page {

	private int currentpage;
	private Integer maxresult;

	public Page(Integer currentpage, Integer maxresult) {
		this.currentpage = currentpage;
		this.maxresult = maxresult;
	}
	
	/* 获取记录的开始索引 */
	public int getFirstCodeIndex() {
		return (this.currentpage - 1) * this.maxresult;
	}

	public int getCurrentpage() {
		return currentpage;
	}

	public void setCurrentpage(int currentpage) {
		this.currentpage = currentpage;
	}

	public Integer getMaxresult() {
		return maxresult;
	}

	public void setMaxresult(Integer maxresult) {
		this.maxresult = maxresult;
	}

	@Override
	public String toString() {
		return currentpage+"";
	}

}
